package com.indexingsystem.db.redis;

import java.text.MessageFormat;

import org.apache.commons.lang3.ObjectUtils;

/**
 * <p>
 * Title: RedisKeyUtil.java
 * </p>
 * <p>
 * Description: 描述
 * </p>
 * 
 */

public class RedisKeyUtil {
	private static final String DEFAULT_PADDING = "*";

	/* 机构模板 */
	public static String digitalhome_institutions_institutions_id(String institutions_id) {
		return MessageFormat.format("digitalhome:institutions:{0}",ObjectUtils.toString(institutions_id, DEFAULT_PADDING));
	}

	// 用户机构关系缓存<key结构digitalhome:institutions:user_id:institutions_id>
	public static String digitalhome_user_institutions_all_institutions_id_user_id(String user_id, String institutions_id) {
		return MessageFormat.format("digitalhome:institutions:{0}:{1}",	ObjectUtils.toString(user_id, DEFAULT_PADDING),	ObjectUtils.toString(institutions_id, DEFAULT_PADDING));
	}
}